package com.example.bankmanage.controller;

import com.example.bankmanage.dto.rep.FetchLoginLogsReqDTO;
import com.example.bankmanage.dto.rep.FetchSystemLogsReqDTO;
import com.example.bankmanage.entity.PageBean;
import com.example.bankmanage.entity.system_logs;
import com.example.bankmanage.result.Result;
import com.example.bankmanage.service.LoginLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api")
@Slf4j
public class LoginLogController {
    @Autowired
    private LoginLogService loginLogService;
    @PostMapping("/login-logs")
    public Result<PageBean> fetchLoginLogs(@RequestBody FetchLoginLogsReqDTO requestParam){
        log.info("查询登录日志操作执行成功");
        PageBean pageBean = loginLogService.fetchLoginLogs(requestParam);
        return Result.success(pageBean);
    }
}
